import {ElRadio, ElRadioButton} from 'element-plus';

export const useRenderRadio = () => {
    const renderRadioOptions = (item) => {
        // 如果有别名，就取别名
        const labelAlias = item?.componentProps?.optionsAlias?.labelField;
        const valueAlias = item?.componentProps?.optionsAlias?.valueField;
        const Com = (item.component === 'Radio' ? ElRadio : ElRadioButton);
        return item?.componentProps?.options?.map((option) => {
            return <Com label={option[labelAlias || 'value']}>{option[valueAlias || 'label']}</Com>;
        });
    };
    return {
        renderRadioOptions
    };
};
//# sourceMappingURL=useRenderRadio.jsx.map